

<!-- 申请售后-订单商品列表 -->
<template>
	<view>
		<!-- header部分 -->
		<view class='header-Container header-height'>
			<view class="header-bg"></view>
			<navHeader pageTitle="申请售后" rightBtnType="msgCenter" colorTheme="black" @toggleMenuListHandler="toggleMenuListHandler">
			</navHeader>
		</view>
		
		<!-- 商品列表 -->
		<view v-if="goodsList && goodsList.length" class="goodsList-Container">
			<goodListAfterSale :list='goodsList'></goodListAfterSale>
		</view>
		<g-empty v-else></g-empty>
		
		<!-- 详情菜单 -->
		<view v-if="showDetailMenu" @click="toggleMenuListHandler()" class="detailMenu-Container">
			<detailMenu></detailMenu>
		</view>
	</view>
</template>

<script>
	import navHeader from '@/components/nav-header/nav-header';
	import detailMenu from "@/components/detailMenu/detailMenu";
	import goodListAfterSale from '@/components/goodList/goodList-afterSale';
	
	export default {
		components: {
			navHeader,
			detailMenu,
			goodListAfterSale,
		},
		data() {
			return {
				
				icon:{
					return: '/static/images/order/return.png',
					msgCenter: '/static/images/common/msg-center.png',
				},
				
				//详情菜单
				showDetailMenu: false,
				
				orderId: "",
				goodsList: []
			};
		},
		onLoad(options) {
			this.orderId = options.orderId;
		},
		onShow(options) {
			this.showDetailMenu = false;
			this.orderGoodsList();
		},
		methods: {
		
			//详情菜单
			toggleMenuListHandler() {
				this.showDetailMenu = !this.showDetailMenu;
			},
			
			
			//商品列表
			orderGoodsList() {
				
				var that = this;
				that.$api.globalUtil.requestAjax({
					url: '/OrderApi/findOrderGoodsInfoByOrderIdForApi',
					method: "POST",
					data: {
						orderId: that.orderId
					},
					success: function(res) {
						if(res.data.success) {
							for(var i = 0; i < res.data.response.length; i++) {
								var goodsData = res.data.response[i];
								goodsData.goodsBaseInfo = JSON.parse(goodsData.goodsBaseInfo);
								console.log(goodsData.goodsBaseInfo)
							}
							
							that.goodsList = res.data.response;
						}
					}
				});
			}
		}
	}
</script>

<style lang="scss">
	page {
		background: #F5F5F5;
	}
	
	/* header部分 */
	.header-Container {
		z-index: 999;
		position: sticky;
		top: 0;
		width: 100%;
		height: 176rpx;
		overflow: hidden;
		box-shadow: 0px 1rpx 1rpx 0px rgba(0, 0, 0, 0.08);
		background: rgba(255, 255, 255, 1);
	
		.leftBtns {
			display: flex;
			align-items: center;
			justify-content: flex-start;
			position: absolute;
			bottom: 0;
			width: 100%;
			height: 86rpx;
	
			.back {
				margin-left: 17rpx;
				width: 44rpx;
				height: 44rpx;
			}
		}
	
		.title {
			position: absolute;
			bottom: 0;
			width: 100%;
			height: 86rpx;
			line-height: 86rpx;
			text-align: center;
			font-size: 36rpx;
			font-family: PingFang SC;
			font-weight: bold;
			color: rgba(51, 51, 51, 1);
		}
	}
	
	
	// 商品列表
	.goodsList-Container {
		padding: 0 30rpx;
		background-color: #FFFFFF;
	}
</style>



